// test user request api
const http = uni.$u.http;
// d登录 
export function login(params){
	return http.post('/api/v6/Comm/login', params,{
		custom:{
			noToken:true,
			ShowLoading: true,
			LoadingText:getApp().$t('api.loading.user.login')
		}
	})
}

// 注册
export function reg(params){
	return http.post('/api/v6/Comm/reg', params,{
		custom:{
			noToken:true,
			ShowLoading: true,
			LoadingText:getApp().$t('api.loading.user.reg')
		}
	})
}

// 自动注册或登录 
export function autologin(params,requestError = true){
	return http.post('/api/v6/Comm/autoReg', params,{
		custom:{
			noToken:true,
			ShowLoading: requestError && true,
			retry:true,//重试
			retry_number:3,//重试3次会递减
			retry_number_all:3,//重试次数总数不会递减
			LoadingText:getApp().$t('api.loading.user.login'),
			requestError
		}
	})
}
// 去实名
export function userAuthAdd(params){
	return http.post('/api/v6/UserAuth/add', params)
}
// 设置语言
export function setLanguage(params){
	return http.post('/api/v6/User/setLanguage', params)
}
// 获取语言
export function getUserLanguage(params){
	return http.get('/api/v6/User/getUserLanguage', {params})
}





// 账户余额
export function getBalance(params){
	return http.get('/api/v6/UserWallet/getBalance', {params})
}
// 修改支付密码
export function setPayPassword(params){
	return http.post('/api/v6/UserWallet/setPayPassword', params)
}

// 实名详情
export function userAuthInfo(){
	return http.get('/api/v6/UserAuth/info')
}
// 收到的红包
export function getReceiveRecordList(params){
	return http.get('/api/v6/RedPacket/getReceiveRecordList', {params})
}
// 发出的红包
export function getSendRecordList(params){
	return http.get('/api/v6/RedPacket/getSendRecordList', {params})
}
// 获取个人信息
export function info(params){
	return http.get('/api/v6/User/info', {params})
}
//获取他人信息
export function userInfo(params){
	return http.get('/api/v6/User/user', {params})
}

//修改个人信息
export function userEdit(params){
	return http.post('/api/v6/User/edit', params)
}

//修改其他信息
export function userEditOther(params){
	return http.post('/api/v6/User/editOtherInfo', params)
}

//修改密码
export function changePassword(params){
	return http.post('/api/v6/User/changePassword', params)
}

//设置密码
export function firstChangePassword(params){
	return http.post('/api/v6/User/firstChangePassword', params)
}


//获取平台信息
export function platinfo(params,requestError){
	return http.get('/api/v6/Plat/info', {
		params,
		custom:{
			requestError
		},
	})
}

